package com.lihui.统计回文;

import com.sun.javaws.IconUtil;

import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

/**
 * 功能描述
 *
 * @author wileda
 * @date 2022/11/24  21:23
 */
public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String strA = sc.nextLine();
        String strB = sc.nextLine();
        int count = 0;
        for (int i = 0; i <= strA.length(); i++) {
            StringBuilder sb = new StringBuilder(strA);
           sb.insert(i,strB);
            if(isPalindrome(sb.toString())){
                count++;
            }
        }
        System.out.println(count);
    }

    public static boolean isPalindrome(String str){
        if(str == null || str.equals("")){
            return true;
        }
        int left = 0;
        int right = str.length() - 1;
        while(left < right){
            if(str.charAt(left) != str.charAt(right)){
                return false;
            }
            left++;
            right--;
        }
        return true;
    }
}
